import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:provider/provider.dart';
import 'package:shop/bottom_navigation_widget.dart';
import 'package:shop/model/MyModelNotifier.dart';
import 'package:shop/model/user_bean.dart';
import 'package:shop/navigation_keep_alive.dart';
import 'package:shop/provider/provider_manager.dart';
import 'package:shop/router/router_manager.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(statusBarColor: Colors.transparent);
  SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);

  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: providers,
      child: MaterialApp(
        title: '底部导航',
        theme: new ThemeData.light(),
//      home: BottomNavigationWidget(),
        home: NavigationKeepAlive(),
        onGenerateRoute: MyRouter.generateRoute,
        localizationsDelegates: [GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate],
        supportedLocales: [const Locale('zh', 'CH'), const Locale('en', 'US')],
      ),
    );
  }
}
